import { GTextFormat } from "../../../../common/GTextFormat";
import { ObjCreate } from "../../common/ObjCreate";
import { LoveTaskCommentInfo } from "../../../model/loveTask/LoveTaskCommentInfo";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { ColorConfig } from "../../../resource/ColorConfig";
import { Language } from "../../../../../extend/language/Language";
//class LoveTaskCommentResItem
    
    export  class LoveTaskCommentResItem /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.initUI();
            return;
        }

        protected initUI(): void
        {
            var loc1=new GTextFormat("", 12, 16104636);
            loc1.align = flash.text.TextFormatAlign.CENTER;
            this._textField = ObjCreate.createTextField("", 0, 0, 460, 20, this, loc1);
            this._textField.autoSize = flash.text.TextFieldAutoSize.CENTER;
            return;
        }

        public updateData(arg1: LoveTaskCommentInfo): void
        {
            if (arg1) 
            {
                this._textField.htmlText = HTMLUtil.addColor(HTMLUtil.addColor(arg1.fromPlayer.name, ColorConfig.instance.getCampColor(arg1.fromPlayer.camp).color) + Language.getString(21217) + HTMLUtil.addColor(arg1.str, "#ffff00") + "    " + Language.getString(32092) + " + " + arg1.charmValue, "#F5BCBC");
            }
            return;
        }

        public dispose(): void
        {
            return;
        }

        public /* override */ get height(): number
        {
            return 30;
        }

        /* internal */ /* var */_textField: Object /* flash.text.TextField */;
    }
